package com.example.demo.common;

public abstract class BaseResponse implements IResponse {

    private int code;

    private String message;

    public BaseResponse() {

    }

    @Override
    public void setCodeAndMessage(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    @Override
    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    @Override
    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public boolean success() {
        return this.code == 0;
    }
}
